/*
csyingwu
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace Kaidou.Model
{

	/// <summary>
	/// IMstUnion interface for NHibernate mapped table 'mst_union'.
	/// </summary>
	public interface IMstUnion
	{
		#region Public Properties
		
		MstUnionId Id
		{
			get ;
			set ;
		}
		
		string OfficeName
		{
			get ;
			set ;
		}
		
		string OfficeKana
		{
			get ;
			set ;
		}
		
		string OfficeZipNo
		{
			get ;
			set ;
		}

        string OfficeZipNo1
        {
            get;
            set;
        }

        string OfficeZipNo2
        {
            get;
            set;
        }
		
		short OfficePrefCode
		{
			get ;
			set ;
		}
		
		string OfficeCity
		{
			get ;
			set ;
		}
		
		string OfficeAddress
		{
			get ;
			set ;
		}
		
		string OfficeTel
		{
			get ;
			set ;
		}
		
		string OfficeFax
		{
			get ;
			set ;
		}
		
		string OfficeEmail
		{
			get ;
			set ;
		}
		
		string DaihyoName
		{
			get ;
			set ;
		}
		
		string DaihyoKana
		{
			get ;
			set ;
		}
		
		string TantoName
		{
			get ;
			set ;
		}
		
		string TantoKana
		{
			get ;
			set ;
		}
		
		string TraderRegNo
		{
			get ;
			set ;
		}
		
		string UserClss
		{
			get ;
			set ;
		}
		
		string Password
		{
			get ;
			set ;
		}
		
		string CancelRestFlg
		{
			get ;
			set ;
		}
		
		string UnionSts
		{
			get ;
			set ;
		}
		
		DateTime RegDate
		{
			get ;
			set ;
		}
		
		DateTime UpdDate
		{
			get ;
			set ;
		}
		
		string UpdUnionCode
		{
			get ;
			set ;
		}
		
		short UpdBranchCode
		{
			get ;
			set ;
		}
		
		string UpdFuncId
		{
			get ;
			set ;
		}

        string TraderRegNo1
        {
            get;
            set;
        }

        string TraderRegNo2
        {
            get;
            set;
        }
		
		bool IsDeleted { get; set; }
		bool IsChanged { get; set; }
		
		#endregion 
	}

	/// <summary>
	/// MstUnion object for NHibernate mapped table 'mst_union'.
	/// </summary>
	[Serializable]
	public class MstUnion : IMstUnion
	{
		#region Member Variables

        public static readonly string STATUS_NORMAL = "10";
        public static readonly String STATUS_DELETE = "99";

        public static readonly String USER_CLSS_KUMIAIIN = "10";
        public static readonly String USER_CLSS_JIMUKYOKU = "20";
        public static readonly String USER_CLSS_OPERATOR = "30";

        public static readonly String CANCEL_REST_FLG_NORMAL = "0";
        public static readonly String CANCEL_REST_FLG_FORCE = "1";

        public static readonly String PASS_CHANGE = "1";

		protected MstUnionId _id;
		protected string _officeName;
		protected string _officeKana;
		protected string _officeZipNo;
        protected string _officeZipNo1;
        protected string _officeZipNo2;
		protected short _officePrefCode;
		protected string _officeCity;
		protected string _officeAddress;
		protected string _officeTel;
		protected string _officeFax;
		protected string _officeEmail;
		protected string _daihyoName;
		protected string _daihyoKana;
		protected string _tantoName;
		protected string _tantoKana;
		protected string _traderRegNo;
		protected string _userClss;
		protected string _password;
		protected string _cancelRestFlg;
		protected string _unionSts;
		protected DateTime _regDate;
		protected DateTime _updDate;
		protected string _updUnionCode;
		protected short _updBranchCode;
		protected string _updFuncId;
		protected bool _isDeleted;
		protected bool _isChanged;
        protected string _traderRegNo1;
        protected string _traderRegNo2;
		#endregion
		
		#region Constructors
		public MstUnion() {}
		
		public MstUnion(MstUnionId id, string officeName, string officeKana, string officeZipNo, short officePrefCode, string officeCity, string officeAddress, string officeTel, string officeFax, string officeEmail, string daihyoName, string daihyoKana, string tantoName, string tantoKana, string traderRegNo, string userClss, string password, string cancelRestFlg, string unionSts, DateTime regDate, DateTime updDate, string updUnionCode, short updBranchCode, string updFuncId)
		{
			this._id = id; /*id*/ 
			this._officeName = officeName; /*c*/ 
			this._officeKana = officeKana; /*c*/ 
			this._officeZipNo = officeZipNo; /*c*/ 
			this._officePrefCode = officePrefCode; /*c*/ 
			this._officeCity = officeCity; /*c*/ 
			this._officeAddress = officeAddress; /*c*/ 
			this._officeTel = officeTel; /*c*/ 
			this._officeFax = officeFax; /*c*/ 
			this._officeEmail = officeEmail; /*c*/ 
			this._daihyoName = daihyoName; /*c*/ 
			this._daihyoKana = daihyoKana; /*c*/ 
			this._tantoName = tantoName; /*c*/ 
			this._tantoKana = tantoKana; /*c*/ 
			this._traderRegNo = traderRegNo; /*c*/ 
			this._userClss = userClss; /*c*/ 
			this._password = password; /*c*/ 
			this._cancelRestFlg = cancelRestFlg; /*c*/ 
			this._unionSts = unionSts; /*c*/ 
			this._regDate = regDate; /*c*/ 
			this._updDate = updDate; /*c*/ 
			this._updUnionCode = updUnionCode; /*c*/ 
			this._updBranchCode = updBranchCode; /*c*/ 
			this._updFuncId = updFuncId; /*c*/ 
		}
		
		#endregion
		
		
		
		#region Public Properties
		
		public MstUnionId Id
		{
			get { return _id; }
			set { _isChanged |= (_id != value); _id = value; }
		}
		
		public string OfficeName
		{
			get { return _officeName; }
			set { _isChanged |= (_officeName != value); _officeName = value; }
		}
		
		public string OfficeKana
		{
			get { return _officeKana; }
			set { _isChanged |= (_officeKana != value); _officeKana = value; }
		}
		
		public string OfficeZipNo
		{
			get { return _officeZipNo; }
			set { _isChanged |= (_officeZipNo != value); _officeZipNo = value; }
		}

        public string OfficeZipNo1
        {
            get { return _officeZipNo1; }
            set { _isChanged |= (_officeZipNo1 != value); _officeZipNo1 = value; }
        }

        public string OfficeZipNo2
        {
            get { return _officeZipNo2; }
            set { _isChanged |= (_officeZipNo2 != value); _officeZipNo2 = value; }
        }

		public short OfficePrefCode
		{
			get { return _officePrefCode; }
			set { _isChanged |= (_officePrefCode != value); _officePrefCode = value; }
		}
		
		public string OfficeCity
		{
			get { return _officeCity; }
			set { _isChanged |= (_officeCity != value); _officeCity = value; }
		}
		
		public string OfficeAddress
		{
			get { return _officeAddress; }
			set { _isChanged |= (_officeAddress != value); _officeAddress = value; }
		}
		
		public string OfficeTel
		{
			get { return _officeTel; }
			set { _isChanged |= (_officeTel != value); _officeTel = value; }
		}
		
		public string OfficeFax
		{
			get { return _officeFax; }
			set { _isChanged |= (_officeFax != value); _officeFax = value; }
		}
		
		public string OfficeEmail
		{
			get { return _officeEmail; }
			set { _isChanged |= (_officeEmail != value); _officeEmail = value; }
		}
		
		public string DaihyoName
		{
			get { return _daihyoName; }
			set { _isChanged |= (_daihyoName != value); _daihyoName = value; }
		}
		
		public string DaihyoKana
		{
			get { return _daihyoKana; }
			set { _isChanged |= (_daihyoKana != value); _daihyoKana = value; }
		}
		
		public string TantoName
		{
			get { return _tantoName; }
			set { _isChanged |= (_tantoName != value); _tantoName = value; }
		}
		
		public string TantoKana
		{
			get { return _tantoKana; }
			set { _isChanged |= (_tantoKana != value); _tantoKana = value; }
		}
		
		public string TraderRegNo
		{
			get { return _traderRegNo; }
			set { _isChanged |= (_traderRegNo != value); _traderRegNo = value; }
		}
		
		public string UserClss
		{
			get { return _userClss; }
			set { _isChanged |= (_userClss != value); _userClss = value; }
		}
		
		public string Password
		{
			get { return _password; }
			set { _isChanged |= (_password != value); _password = value; }
		}
		
		public string CancelRestFlg
		{
			get { return _cancelRestFlg; }
			set { _isChanged |= (_cancelRestFlg != value); _cancelRestFlg = value; }
		}
		
		public string UnionSts
		{
			get { return _unionSts; }
			set { _isChanged |= (_unionSts != value); _unionSts = value; }
		}
		
		public DateTime RegDate
		{
			get { return _regDate; }
			set { _isChanged |= (_regDate != value); _regDate = value; }
		}
		
		public DateTime UpdDate
		{
			get { return _updDate; }
			set { _isChanged |= (_updDate != value); _updDate = value; }
		}
		
		public string UpdUnionCode
		{
			get { return _updUnionCode; }
			set { _isChanged |= (_updUnionCode != value); _updUnionCode = value; }
		}
		
		public short UpdBranchCode
		{
			get { return _updBranchCode; }
			set { _isChanged |= (_updBranchCode != value); _updBranchCode = value; }
		}
		
		public string UpdFuncId
		{
			get { return _updFuncId; }
			set { _isChanged |= (_updFuncId != value); _updFuncId = value; }
		}

        public string TraderRegNo1
        {
            get { return _traderRegNo1; }
            set { _isChanged |= (_traderRegNo1 != value); _traderRegNo1 = value; }
        }

        public string TraderRegNo2
        {
            get { return _traderRegNo2; }
            set { _isChanged |= (_traderRegNo2 != value); _traderRegNo2 = value; }
        }

		public bool IsDeleted
		{
			get { return _isDeleted; }
			set { _isDeleted = value; }
		}
		
		public bool IsChanged
		{
			get { return _isChanged; }
			set { _isChanged = value; }

		}
		
		#endregion 
	}
	
	#region Custom ICollection interface for MstUnion 

	
	public interface IMstUnionCollection : ICollection
	{
		MstUnion this[int index]{	get; set; }
		void Add(MstUnion pMstUnion);
		void Clear();
	}
	
	[Serializable]
	public class MstUnionCollection : IMstUnionCollection
	{
		private IList<MstUnion> _arrayInternal;

		public MstUnionCollection()
		{
			_arrayInternal = new List<MstUnion>();
		}
		
		public MstUnionCollection( IList<MstUnion> pSource )
		{
			_arrayInternal = pSource;
			if(_arrayInternal == null)
			{
				_arrayInternal = new List<MstUnion>();
			}
		}

		public MstUnion this[int index]
		{
			get
			{
				return _arrayInternal[index];
			}
			set
			{
				_arrayInternal[index] = value;
			}
		}

		public int Count { get { return _arrayInternal.Count; } }
		public bool IsSynchronized { get { return false; } }
		public object SyncRoot { get { return _arrayInternal; } }
		public void CopyTo(Array array, int index){ _arrayInternal.CopyTo((MstUnion[])array, index); }
		public IEnumerator GetEnumerator() { return _arrayInternal.GetEnumerator(); }
		public void Add(MstUnion pMstUnion) { _arrayInternal.Add(pMstUnion); }
		public void Clear() { _arrayInternal.Clear(); }
		public IList<MstUnion> GetList() { return _arrayInternal; }
	 }
	
	#endregion
}
